import React from "react";
import { connect } from "react-redux";

function CartShow(props) {
  return (
    <div>
      <div className="main container">
        <div className="cart">
          <div className="cart_con">
            <div className="cartcon_title">
              <span>
                <input type="checkbox" /> 全选
              </span>
              <span>商品信息</span>
              <span>单价</span>
              <span>数量</span>
              <span>金额</span>
              <span>操作</span>
            </div>
            <ul>
              {!props.bc ? (
                <h2>购物车中没有任何商品！</h2>
              ) : (
                <>
                  <li>
                    <input type="checkbox" className="cart_checkbox" />
                    <a href="" className="cart_img">
                      <img src="product-imgs/jhq-m8088a.jpg" alt="" />
                    </a>
                    <a href="" className="cart_title">
                      家用除甲醛静音M-8088A
                    </a>
                    <i>¥1599</i>
                    <div>
                      <span>-</span>
                      <input type="text" defaultValue={props.bc} />
                      <span>+</span>
                    </div>
                    <strong>¥{props.bc * 1599.0}</strong>
                    <em></em>
                  </li>
                </>
              )}
            </ul>
          </div>
          <div className="cart_header">
            <button type="button">结算</button>
          </div>
        </div>
      </div>
    </div>
  );
}
function mapStateToProps(state) {
  return {
    bc: state.buyCount,
  };
}
export default connect(mapStateToProps, null)(CartShow);
